/*
 * @Author: jerrery.li
 * @Date: 2024-03-27 14:34:00
 * @LastEditors: jerrery.li
 * @LastEditTime: 2024-04-01 14:31:03
 * @FilePath: /react-project/src/App.js
 * @Description:
 */
import React from "react";
import {
    BrowserRouter,
    HashRouter,
    Routes,
    Route,
    Navigate,
} from "react-router-dom";
import Login from "./views/Login";
import Register from "./views/Register";
import Home from "./views/Home";
import NotFind from "./views/NotFind";
import Main from "./views/subs/Main";
import User from "./views/subs/User";
import Role from "./views/subs/Role";
import Shop from "./views/subs/Shop";
import ProductCategory from "./views/subs/ProductCategory";
import ProductList from "./views/subs/ProductList";
import Salary from "./views/subs/Salary";
import Sale from "./views/subs/Sale";


export default function App() {
    return (
        <div>
            <HashRouter>
                <Routes>
                    {/* <Route path="/" element={<Navigate to="/home" />}></Route> */}
                    <Route index element={<Home />}></Route>
                    <Route path="/home" element={<Home />}>
                        <Route index element={<Main />}></Route>
                        <Route path="user" element={<User />} />
                        <Route path="role" element={<Role />} />
                        <Route path="shop" element={<Shop />} />
                        <Route path="productCategory" element={<ProductCategory />} />
                        <Route path="productList" element={<ProductList />} />
                        <Route path="salary" element={<Salary />} />
                        <Route path="sale" element={<Sale />} />
                    </Route>
                    <Route path="/login" element={<Login />}></Route>
                    <Route path="/register" element={<Register />}></Route>
                    <Route path="/404" element={<NotFind />}></Route>
                    <Route path="*" element={<Navigate to="/404" />}></Route>
                </Routes>
            </HashRouter>
        </div>
    );
}
